/*
 * @Author: Marte
 * @Date:   2016-10-24 11:41:54
 * @Last Modified by:   Marte
 * @Last Modified time: 2016-10-25 18:01:42
 */

'use strict';

var sequelizeService = require('../utils/sequelizeService');

sequelizeService.sequelize
    .sync()
    .then(function() {
        var model = sequelizeService.models.PicTypeRemarkGroup;

        var arr = [{
            PicId: 3,
            TypeId: 1,
            RemarkId: 1,
            RemarkGroupId: 1
        }, {
            PicId: 3,
            TypeId: 1,
            RemarkId: 2,
            RemarkGroupId: 5
        }, {
            PicId: 4,
            TypeId: 1,
            RemarkId: 2,
            RemarkGroupId: 5
        }, {
            PicId: 5,
            TypeId: 1,
            RemarkId: 1,
            RemarkGroupId: 2
        }];

        model
            .bulkCreate(arr, { individualHooks: true })
            .then(function() {
                console.log('新增 %d 条记录', arr.length);
            })
            .error(function(err) {
                console.log(err);
            });
    });
